/*

package com.chinasofti.Servlet;

import com.chinasofti.sql.ConnSql;
import net.sf.json.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
@WebServlet("/regist")
public class RegisterServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String name = request.getParameter("name");
        String password = request.getParameter("pass");
        System.out.println("注册的名字"+name);
        System.out.println("注册的密码"+password);
        //字符串
        String str="username:"+name+"&"+"password:"+password;
        System.out.println(str);
        ConnSql.connect();
        int bl=ConnSql.insert(name,password);
        System.out.println(bl);
        //返回json数据
        response.setContentType("txt/html;charset=UTF-8");
        JSONObject obj=new JSONObject();
        if (bl==0){
            obj.put("code", 200);
        }else {
            obj.put("code", 500);
        }
        response.getWriter().write(obj.toString());
    }

}
*/
